package com.zengge.zbc.utils;

public class SnowFlakeIdGenerator {

    private static SnowFlakeId snowFlakeId;

    public static void init(SnowFlakeId snowFlakeId) {
        SnowFlakeIdGenerator.snowFlakeId = snowFlakeId;
    }


    public static long next() {
        if (snowFlakeId == null) {
            throw new NullPointerException("Snow flake id is null");
        }
        return snowFlakeId.generateId();
    }
}
